package com.sanyang.pda.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.sanyang.pda.bean.StockAbnormalBean;
import com.sanyang.pda.utils.Utils;
import com.wangshen.base.ui.mvp.base.adapter.BaseAdapter;
import com.wangshen.projectbase.R;

import java.util.List;

public class StockAbnormalAdapter extends BaseAdapter<StockAbnormalBean> {
    public StockAbnormalAdapter(int layoutResId, @Nullable List<StockAbnormalBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, StockAbnormalBean item) {
        super.convert(helper, item);
        helper.setText(R.id.tv_sequenceNo,"："+item.getSequenceNo());
        helper.setText(R.id.tv_storagebinId,"："+item.getStoragebinId());
        helper.setText(R.id.tv_inventory,item.getStockNum()+ Utils.getArticleUnit(getContext(),item.getArticleUnit()));
        helper.setText(R.id.tv_actualNum,item.getActualNum()+ Utils.getArticleUnit(getContext(),item.getArticleUnit()));
        helper.setText(R.id.tv_goods_code,item.getArticleId());
        helper.setText(R.id.tv_goods_name,item.getArticleName());
        helper.setText(R.id.tv_specification,item.getSpec()+"");
        helper.setText(R.id.tv_delivery_time,item.getEntryTime());
        helper.setText(R.id.tv_product_time,item.getProductTime());
        helper.setText(R.id.tv_admire_date,item.getExpiringTime());
        if (item.getCheckStatus() == 0){
            helper.setText(R.id.tv_quality_status,getContext().getString(R.string.without_quality_inspection));
        }else if (item.getCheckStatus() == 10){
            helper.setText(R.id.tv_quality_status,getContext().getString(R.string.quality_inspection));
        }else {
            helper.setText(R.id.tv_quality_status,getContext().getString(R.string.have_quality_inspection));
        }


    }
}
